<script language="javascript">
function selcheck() {
		var objs = document.getElementsByName("power[]");
		for(var i=0; i<objs.length; i++) {
			if(objs[i].type.toLowerCase() == "checkbox" && !(objs[i].checked)){
			objs[i].checked = true;
		} else if(objs[i].type.toLowerCase() == "checkbox" && objs[i].checked) {
			objs[i].checked = false;
		}
	}
}
</script>
<table width="99%" border="0" align="center" id="datalist"  cellpadding="3" cellspacing="1" class="table_style">
    <tr>
        <td width="10%" align="right">全选<input type="checkbox" onClick="selcheck()"></td>
        <td align="left" width="80%">操作</td>
    </tr>
<?php if(!empty($power)):?>
<?php foreach($power as $v):?>
    <tr>
        <td width="20%" align="right"><input type="checkbox" name="power[]" value="<?php echo $v;?>"></td>
        <td width="80%" align="left"><?php echo $v;?></td>
    </tr>
<?php endforeach;?>
<?php endif;?>
</table>